package org.domain.sigepac.Entity;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@Table(name = "tb_avaliacao_psicogenese")
public class AvaliacaoPsicogenese extends EntidadeAbstrata implements Cloneable {

	private static final long serialVersionUID = -6088931453148770266L;

	@Override
	public AvaliacaoPsicogenese clone() throws CloneNotSupportedException {
		return (AvaliacaoPsicogenese) super.clone();
	}
	
	@EmbeddedId
	private AvaliacaoPsicogeneseId id=new AvaliacaoPsicogeneseId();
	
	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade({CascadeType.ALL})
	@JoinColumn(name = "id_aluno", insertable = false, updatable = false)
	private Aluno aluno;
	
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_psicogenese", insertable = false, updatable = false)
	private Psicogenese psicogenese;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_turma", insertable = false, updatable = false)
	private Turma turma;
	
	
	
	public Serializable getId() {
		// TODO Auto-generated method stub
		return id;
	}
	
	public void setId(AvaliacaoPsicogeneseId id) {
		this.id = id;
	}

	public Aluno getAluno() {
		return aluno;
	}

	
	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
		//((AvaliacaoPsicogeneseId)getId()).setIdAluno((Integer)aluno.getId());
	}
	

	public Psicogenese getPsicogenese() {
		return psicogenese;
	}
	
	public Turma getTurma() {
		return turma;
	}
	public void setTurma(Turma turma) {
		this.turma = turma;
		//((AvaliacaoPsicogeneseId)getId()).setIdTurma((Integer)turma.getId());
	}

	public void setPsicogenese(Psicogenese psicogenese) {
		this.psicogenese=psicogenese;
		//((AvaliacaoPsicogeneseId)getId()).setIdPsicogenese((Integer)psicogenese.getId());
	}

}
